<cffile action="upload"
		destination="D:\home\nilesbbleague.com\wwwroot\GameFiles"
		nameConflict="overwrite"
		fileField="Form.FiletoUpload">
		

<cffile action="read" 
	file="D:\home\nilesbbleague.com\wwwroot\GameFiles\#cffile.ClientFileName#.#cffile.ClientFileExt#" 
    variable="readfile">
<cfset XMLdoc = XMLParse(readfile)>

<cfoutput>
<table align="center" width="95%">
	<tr>
    	<td colspan="3"></td>
    </tr>
	<tr>
    	<td width="45%" align="right"><h2>#xmlDoc.report.result[1].xmlattributes.team#</h2></td>
        <td width="10%" align="center">Vs.</td>
        <td width="45%" align="left"><h2>#xmlDoc.report.result[2].xmlattributes.team#</h2></td>
    </tr>
    <tr>
    	<td></td>
        <td align="center"><cfoutput>#xmlDoc.report.gate.xmltext#</cfoutput></td>
        <td></td>
    </tr>
    <tr>
    	<td align="right">#xmlDoc.report.result[1].score.xmltext#</td>
        <td align="center"><h2>Score</h2></td>
        <td align="left">#xmlDoc.report.result[2].score.xmltext#</td>
    </tr
    <tr>
    	<td align="right">#xmlDoc.report.result[1].winnings.xmltext#</td>
        <td align="center"><h2>Winnings</h2></td>
        <td align="left">#xmlDoc.report.result[2].winnings.xmltext#</td>
    </tr>
    <tr>
    	<td align="right"><cfif xmlDoc.report.result[1].fanfactor.xmltext eq 0>No Change<cfelse>#xmlDoc.report.result[1].fanfactor.xmltext#</cfif></td>
        <td align="center"><h2>Fan Factor</h2></td>
        <td align="left"><cfif xmlDoc.report.result[2].fanfactor.xmltext eq 0>No Change<cfelse>#xmlDoc.report.result[2].fanfactor.xmltext#</cfif></td>
    </tr>
    <tr>
    	<td align="right">#xmlDoc.report.result[1].luck.xmltext#%</td>
        <td align="center"><h2>Luck</h2></td>
        <td align="left">#xmlDoc.report.result[2].luck.xmltext#%</td>
    </tr>
	<tr>
    	<td colspan="3" align="center">
			<table>
                <tr valign="top">
                	<td align="right" width="49%">
                    	<cfset PlayerNodes = xmlSearch(readfile,'/report/result[1]/players/performance')>
                    	<table border="2">
                        	<!--- Left game results table --->
                        	<tr>
                            	<td colspan="2">Player</td>
                                <td>Cps</td>
                                <td>TDs</td>
                                <td>Int</td>
                                <td>Cas</td>
                                <td>MVP</td>
                                <td>SPP</td>
                                <td>Pass</td>
                                <td>Rush</td>
                                <td>Blocks</td>
                                <td>Fouls</td>
                        	</tr>
							<cfloop from="1" to="#arraylen(PlayerNodes)#" index="i">
                            <cfset PlayerXML = xmlparse(PlayerNodes[i])>
                            	<tr>
                                    <td align="center">#PlayerXML.performance.xmlattributes.player#</td>
                                    <td align="center">player Name</td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "completions" ) >#PlayerXML.performance.completions#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "touchdowns" ) >#PlayerXML.performance.touchdowns#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "interceptions" ) >#PlayerXML.performance.interceptions#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "casualties" ) >#PlayerXML.performance.casualties#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "mvps" ) >#PlayerXML.performance.mvps#<cfelse>0</cfif></td>
                                    <td align="center">SPP</td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "passing" ) >#PlayerXML.performance.passing#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "rushing" ) >#PlayerXML.performance.rushing#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "blocks" ) >#PlayerXML.performance.blocks#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "fouls" ) >#PlayerXML.performance.fouls#<cfelse>0</cfif></td>
                                </tr> 
                            </cfloop>
                        </table>
					</td>  
                        	<!--- Spacer betwen tables --->                  
                    <td align="center" width="2%"></td>
                    
                    <td align="left" width="49%">
                    	<cfset PlayerNodes = xmlSearch(readfile,'/report/result[2]/players/performance')>
                        <table border="2">
                        	<!--- Right game results table --->
                            <tr>
                            	<td colspan="2">Player</td>
                                <td>Cps</td>
                                <td>TDs</td>
                                <td>Int</td>
                                <td>Cas</td>
                                <td>MVP</td>
                                <td>SPP</td>
                                <td>Pass</td>
                                <td>Rush</td>
                                <td>Blocks</td>
                                <td>Fouls</td>
                        	</tr>
                            <cfloop from="1" to="#arraylen(PlayerNodes)#" index="i">
							<cfset PlayerXML = xmlparse(PlayerNodes[i])>
                            	<tr>
                                    <td align="center">#PlayerXML.performance.xmlattributes.player#</td>
                                    <td align="center">player Name</td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "completions" ) >#PlayerXML.performance.completions#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "touchdowns" ) >#PlayerXML.performance.touchdowns#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "interceptions" ) >#PlayerXML.performance.interceptions#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "casualties" ) >#PlayerXML.performance.casualties#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "mvps" ) >#PlayerXML.performance.mvps#<cfelse>0</cfif></td>
                                    <td align="center">SPP</td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "passing" ) >#PlayerXML.performance.passing#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "rushing" ) >#PlayerXML.performance.rushing#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "blocks" ) >#PlayerXML.performance.blocks#<cfelse>0</cfif></td>
                                    <td align="center"><cfif structKeyExists(PlayerXML.performance, "fouls" ) >#PlayerXML.performance.fouls#<cfelse>0</cfif></td>
                                </tr> 
                            </cfloop>
                    	</table>
                    </td>
                </tr>
            </table>
        </td>
	</tr>
</table>
</cfoutput>

<cfdump var="#xmldoc#">